using System;
using System.Runtime.CompilerServices;
using HslCommunication;

namespace Catastrophe.AutoSulution.TaskM
{
	public class TaskDescribeEntity
	{
		/// <summary>
		/// 执行的方法名称
		/// </summary>
		public string MethodName { get; set; }

		/// <summary>
		/// 编号
		/// </summary>
		public ushort Index { get; set; }

		/// <summary>
		/// 方法描述
		/// </summary>
		public string Describe { get; set; }

		/// <summary>
		/// 执行状态
		/// </summary>
		public string RunStatus { get; set; }

		/// <summary>
		/// 异常
		/// </summary>
		public Exception Error { get; set; }

		/// <summary>
		/// 标识
		/// </summary>
		public int? Flag { get; set; }

		/// <summary>
		/// 时间戳
		/// </summary>
		public string TimeStamp { get; set; }

		/// <summary>
		/// 执行结果
		/// </summary>
		public OperateResult OprResult { get; set; }

		/// <summary>
		/// 进度值
		/// </summary>
		public int ProcessValue { get; set; }

		public override string ToString()
		{
			DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(30, 14);
			defaultInterpolatedStringHandler.AppendLiteral("方法名称:");
			defaultInterpolatedStringHandler.AppendFormatted(this.MethodName);
			defaultInterpolatedStringHandler.AppendFormatted(Environment.NewLine);
			defaultInterpolatedStringHandler.AppendLiteral("编号:");
			defaultInterpolatedStringHandler.AppendFormatted(this.Index);
			defaultInterpolatedStringHandler.AppendFormatted(Environment.NewLine);
			defaultInterpolatedStringHandler.AppendLiteral("描述:");
			defaultInterpolatedStringHandler.AppendFormatted(this.Describe);
			defaultInterpolatedStringHandler.AppendFormatted(Environment.NewLine);
			defaultInterpolatedStringHandler.AppendLiteral("执行状态:");
			defaultInterpolatedStringHandler.AppendFormatted(this.RunStatus);
			defaultInterpolatedStringHandler.AppendFormatted(Environment.NewLine);
			defaultInterpolatedStringHandler.AppendLiteral("执行进度:");
			defaultInterpolatedStringHandler.AppendFormatted(this.ProcessValue);
			defaultInterpolatedStringHandler.AppendFormatted(Environment.NewLine);
			defaultInterpolatedStringHandler.AppendLiteral("异常:");
			defaultInterpolatedStringHandler.AppendFormatted(this.Error);
			defaultInterpolatedStringHandler.AppendFormatted(Environment.NewLine);
			defaultInterpolatedStringHandler.AppendLiteral("标识:");
			defaultInterpolatedStringHandler.AppendFormatted(this.Flag);
			defaultInterpolatedStringHandler.AppendLiteral("时间:");
			defaultInterpolatedStringHandler.AppendFormatted(this.TimeStamp);
			return defaultInterpolatedStringHandler.ToStringAndClear();
		}

		public TaskDescribeEntity()
		{
			DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(0, 1);
			defaultInterpolatedStringHandler.AppendFormatted(DateTime.Now, "yyyy/MM/dd HH:mm:ss:fff");
			this.TimeStamp = defaultInterpolatedStringHandler.ToStringAndClear();
		}
	}
}
